module.exports = app => {
  // 添加params属性,方便获取get或post请求参数
  app.use(async (ctx, next) => {
    ctx.params = {
      ...ctx.request.body,
      ...ctx.query
    };
    await next();
  });
};